var barWitdh = $('#bar').width()-20;
option = {
    legend: {
        show:false
    },
    tooltip: {},
    dataset: {
        source: [

            ['注册人员（300）',0,0,0,0, 150, 150, 80,0,0,0,0],
            ['中级及以上职称人员（400）',0,0,0,0, 260, 200,0,0,0,0,0],
            ['现场管理人员（180）', 20, 20, 30,20,40,10,40,8,25,15,45],
            ['技术工人（237）',0, 0,0,150, 5, 100]
        ]
    },
    xAxis: {
        type: 'category',
        axisLabel: {
            interval:0,
            color:'#333'

        },
        axisLine: {
            lineStyle:{
                color:'#ccc'
            }
        }

    },
    yAxis: {
        name:'单位（人）',
        boundaryGap:['0','40%'],
        axisLine: {
            lineStyle:{
                color:'#ccc'
            }
        },
        axisLabel: {
            color:'#333'
        },
        axisTick: {
            show:false
        },
        splitLine: {
            show: true,
            lineStyle:{
                type:'dashed',
                color:'#eee'
            }
        }

    },
    grid: {
        width:barWitdh,
        left:40,
        height:300

    },
    // Declare several bar series, each will be mapped
    // to a column of dataset.source by default.
    series: [
        {
            type: 'bar',
            color:'#7ecff5',
            name:'aaa1'

        },
        {
            type: 'bar',
            color:'#4cb5bb',
            name:'aaa2'
        },
        {
            type: 'bar',
            color:'#ffb144',
            name:'aaa3'

        },
        {
            type: 'bar',
            color:'#7ecff5',
            name:'aaa4'

        },
        {
            type: 'bar',
            color:'#4cb5bb',
            name:'aaa5'

        },
        {
            type: 'bar',
            color:'#ffb144',
            name:'aaa6'

        },
        {
            type: 'bar',
            color:'#7ecff5',
            name:'aaa7'

        },
        {
            type: 'bar',
            color:'#4cb5bb',
            name:'aaa8'

        },
        {
            type: 'bar',
            color:'#ffb144',
            name:'aaa9'

        },
        {
            type: 'bar',
            color:'#7ecff5',
            name:'aaa10'

        },
        {
            type: 'bar',
            color:'#4cb5bb',
            name:'aaa11'

        }
    ]
}




var myChart = echarts.init(document.getElementById('bar'));
myChart.setOption(option);
$(window).resize(function(){
    barWitdh = $('#bar').width();
    myChart.resize();
});